In the event of technical difficulties with Szkopuł, please contact us via email at [email protected].
If you would like to talk about tasks, solutions or technical problems, please visit our Discord servers. They are moderated by the community, but members of the support team are also active there.
Psst... Ruszyły zawody olimpiady informatycznej dla uczniów szkół podstawowych i średnich. Zadania na tych konkursach są bardzo podobne do zadań, które rozwiązujesz, tutaj, na Szkopule. Zobacz więcej:
- dla uczniów szkół podstawowych: oij.edu.pl/start/
- dla uczniów szkół średnich: oi.edu.pl/l/jak_zaczac/
Byteasar owns a garden in which he grows apple-trees bearing golden apples.
The work in the garden is quite hard and Byteasar is not as strong and healthy
as he used to be in the old days.
Therefore he decided to divide his garden into parcels that he would give
to his sons.
Byteasar would like each of his sons to have a wealthy life, so
he would like each of the parcels to contain at least one of the priceless apple-trees.
Byteasar's garden has the shape of an square.
For simplicity we introduce a rectangular coordinate system in the garden, in which
the lower left corner of the garden has coordinates and the upper right corner
has coordinates .
Some unit squares contain apple-trees.
Each of the parcels should be a rectangle with sides parallel to the axes of the coordinate
system and integer coordinates of corners.
The sides of the parcels may touch, but the parcels cannot overlap.
The parcels should cover the whole garden.
Each parcel may have an arbitrary size and must contain at least one apple-tree.
You may assume that the desired division of the garden is possible to accomplish.
Input
The first line of input contains two integers and
(, ) that represent
the length of the side of the garden and the number of Byteasar's sons.
The following lines describe the unit squares of the garden.
Each of those lines contains characters x and/or .
that represent a unit square with or without an apple-tree, respectively.
Output
Your program should output lines that describe a correct division of
the garden into parcels.
Each of the lines should contain four integers , , ,
that give the coordinates of the lower left and the upper right
corner of the garden.
The order of the parcels in the output does not matter.